package com.cs.bd.ad.bean;

import com.cs.bd.ad.http.bean.BaseAppInfoBean;
import com.cs.bd.ad.http.bean.BaseOnlineAdInfoBean;
import com.cs.bd.utils.StringUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class AdInfoBean implements Serializable {
    private static final long serialVersionUID = 1L;
    public static final int AD_TYPE_FIXED_DISPLAY = 1;
    public static final int AD_TYPE_RANDOM_DISPLAY = 2;
    private int mVirtualModuleId;
    private int mModuleId;
    private int mAdId;
    private String mCategory;
    private int mMapId;
    private String mPackageName;
    private String mName;
    private String mIcon;
    private String mBanner;
    private String mBannerTitle;
    private String mBannerDescribe;
    private boolean mIsH5Adv;
    private boolean mIsBrandAdv = false;
    private String mPreview;
    private String mVersionName;
    private String mVersionNumber;
    private String mScore;
    private String mPrice;
    private String mDeveloper;
    private String mDownloadCountStr;
    private String mDetail;
    private int mDownType;
    private String mDownUrl;
    private String mRemdMsg;
    private int mAdSrc;
    private String mShowCallUrl;
    private String mClickCallUrl;
    private String mInstallCallUrl;
    private int mIsAd;
    private String mAdUrl;
    private int mAdPreload;
    private int mAdType;
    private int mUASwitcher;
    private String mAdInfoCacheFileName;
    private int mAdvDataSource;
    private String mSize;
    private String mCparams;
    private String mImgfull;
    private int mCorpId = -1;
    private String mAppDescription;
    private long mDSize;
    private int mFrequency;
    private int mOnlineAdvType;
    private String[] mCorrelationNames;
    private String[] mFilterNames;
    private boolean mShouldSendReferBroadcast = false;
    public static final int UATYPE_CS_SWITCH = 0;
    public static final int UATYPE_CS_NONE = 1;
    public static final int UATYPE_CS_FULL = 2;
    public static final int UATYPE_CS_HALF = 3;
    public static final int UATYPE_CS_FAKE = 4;
    private int mUAType = 0;
    private int mFinalGpJump;
    private long mCsAdBannerId = -1L;

    public AdInfoBean() {
    }

    public int getUASwitcher() {
        return this.mUASwitcher;
    }

    public void setUASwitcher(int switcher) {
        this.mUASwitcher = switcher;
    }

    public int getVirtualModuleId() {
        return this.mVirtualModuleId;
    }

    public void setVirtualModuleId(int virtualModuleId) {
        this.mVirtualModuleId = virtualModuleId;
    }

    public int getModuleId() {
        return this.mModuleId;
    }

    public void setModuleId(int moduleId) {
        this.mModuleId = moduleId;
    }

    public int getAdId() {
        return this.mAdId;
    }

    public void setAdId(int adId) {
        this.mAdId = adId;
    }

    public String getCategory() {
        return this.mCategory;
    }

    public void setCategory(String category) {
        this.mCategory = category;
    }

    public int getMapId() {
        return this.mMapId;
    }

    public void setMapId(int mMapId) {
        this.mMapId = mMapId;
    }

    public String getPackageName() {
        return this.mPackageName;
    }

    public void setPackageName(String packageName) {
        this.mPackageName = packageName;
    }

    public String getName() {
        return this.mName;
    }

    public void setName(String name) {
        this.mName = name;
    }

    public String getIcon() {
        return this.mIcon;
    }

    public void setIcon(String icon) {
        this.mIcon = icon;
    }

    public String getBanner() {
        return this.mBanner;
    }

    public void setBanner(String banner) {
        this.mBanner = banner;
    }

    public String getBannerTitle() {
        return this.mBannerTitle;
    }

    public void setBannerTitle(String bannerTitle) {
        this.mBannerTitle = bannerTitle;
    }

    public String getBannerDescribe() {
        return this.mBannerDescribe;
    }

    public void setBannerDescribe(String bannerDescribe) {
        this.mBannerDescribe = bannerDescribe;
    }

    public boolean getIsH5Adv() {
        return this.mIsH5Adv;
    }

    public void setIsH5Adv(boolean b) {
        this.mIsH5Adv = b;
    }

    public void setPreview(String preview) {
        this.mPreview = preview;
    }

    public String getPreview() {
        return this.mPreview;
    }

    public String getVersionName() {
        return this.mVersionName;
    }

    public void setVersionName(String versionName) {
        this.mVersionName = versionName;
    }

    public String getVersionNumber() {
        return this.mVersionNumber;
    }

    public void setVersionNumber(String versionNumber) {
        this.mVersionNumber = versionNumber;
    }

    public String getScore() {
        return this.mScore;
    }

    public void setScore(String score) {
        this.mScore = score;
    }

    public String getPrice() {
        return this.mPrice;
    }

    public void setPrice(String price) {
        this.mPrice = price;
    }

    public String getDeveloper() {
        return this.mDeveloper;
    }

    public void setDeveloper(String developer) {
        this.mDeveloper = developer;
    }

    public String getDownloadCountStr() {
        return this.mDownloadCountStr;
    }

    public void setDownloadCountStr(String downloadCountStr) {
        this.mDownloadCountStr = downloadCountStr;
    }

    public String getDetail() {
        return this.mDetail;
    }

    public void setDetail(String detail) {
        this.mDetail = detail;
    }

    public int getDownType() {
        return this.mDownType;
    }

    public void setDownType(int downType) {
        this.mDownType = downType;
    }

    public String getDownUrl() {
        return this.mDownUrl;
    }

    public void setDownUrl(String downUrl) {
        this.mDownUrl = downUrl;
    }

    public String getRemdMsg() {
        return this.mRemdMsg;
    }

    public void setRemdMsg(String remdMsg) {
        this.mRemdMsg = remdMsg;
    }

    public int getAdSrc() {
        return this.mAdSrc;
    }

    public void setAdSrc(int adSrc) {
        this.mAdSrc = adSrc;
    }

    public String getShowCallUrl() {
        return this.mShowCallUrl;
    }

    public void setShowCallUrl(String showCallUrl) {
        this.mShowCallUrl = showCallUrl;
    }

    public String getClickCallUrl() {
        return this.mClickCallUrl;
    }

    public void setClickCallUrl(String clickCallUrl) {
        this.mClickCallUrl = clickCallUrl;
    }

    public String getInstallCallUrl() {
        return this.mInstallCallUrl;
    }

    public void setInstallCallUrl(String installCallUrl) {
        this.mInstallCallUrl = installCallUrl;
    }

    public int getIsAd() {
        return this.mIsAd;
    }

    public void setIsAd(int isAd) {
        this.mIsAd = isAd;
    }

    public String getAdUrl() {
        return this.mAdUrl;
    }

    public void setAdUrl(String adUrl) {
        this.mAdUrl = adUrl;
    }

    public int getAdPreload() {
        return this.mAdPreload;
    }

    public void setAdPreload(int adPreload) {
        this.mAdPreload = adPreload;
    }

    public int getAdType() {
        return this.mAdType;
    }

    public void setAdType(int adType) {
        this.mAdType = adType;
    }

    public String getAdInfoCacheFileName() {
        return this.mAdInfoCacheFileName;
    }

    public void setAdInfoCacheFileName(String adInfoCacheFileName) {
        this.mAdInfoCacheFileName = adInfoCacheFileName;
    }

    public int getAdvDataSource() {
        return this.mAdvDataSource;
    }

    public void setAdvDataSource(int advDataSource) {
        this.mAdvDataSource = advDataSource;
    }

    public int getOnlineAdvType() {
        return this.mOnlineAdvType;
    }

    public void setOnlineAdvType(int mOnlineAdvType) {
        this.mOnlineAdvType = mOnlineAdvType;
    }

    public String getSize() {
        return this.mSize;
    }

    public void setSize(String size) {
        this.mSize = size;
    }

    public boolean isBrandAdv() {
        return this.mIsBrandAdv;
    }

    public String getCparams() {
        return this.mCparams;
    }

    public void setCparams(String mCparams) {
        this.mCparams = mCparams;
    }

    public String getImgfull() {
        return this.mImgfull;
    }

    public void setImgfull(String mImgfull) {
        this.mImgfull = mImgfull;
    }

    public long getDSize() {
        return this.mDSize;
    }

    public int getCorpId() {
        return this.mCorpId;
    }

    public String getAppDescription() {
        return this.mAppDescription;
    }

    public void setDSize(int mDSize) {
        this.mDSize = (long)mDSize;
    }

    public int getFrequency() {
        return this.mFrequency;
    }

    public void setFrequency(int mFrequency) {
        this.mFrequency = mFrequency;
    }

    public int getmFinalGpJump() {
        return this.mFinalGpJump;
    }

    public int getUAType() {
        return this.mUAType;
    }

    public void setUAType(int mUAType) {
        this.mUAType = mUAType;
    }

    public String[] getCorrelationNames() {
        return this.mCorrelationNames;
    }

    public String[] getFilterNames() {
        return this.mFilterNames;
    }

    public long getCsAdBannerId() {
        return this.mCsAdBannerId;
    }

    public boolean shouldSendReferBroadcast() {
        return this.mShouldSendReferBroadcast;
    }

    public static List<AdInfoBean> conversionFormOnlineAdInfoBean(List<BaseOnlineAdInfoBean> onlineAdInfoList) {
        if (onlineAdInfoList != null && !onlineAdInfoList.isEmpty()) {
            List<AdInfoBean> adInfoList = new ArrayList();
            Iterator var3 = onlineAdInfoList.iterator();

            while(var3.hasNext()) {
                BaseOnlineAdInfoBean onlineAdInfoBean = (BaseOnlineAdInfoBean)var3.next();
                if (onlineAdInfoBean != null) {
                    AdInfoBean adInfoBean = new AdInfoBean();
                    adInfoBean.mUASwitcher = onlineAdInfoBean.getUASwitcher();
                    adInfoBean.mVirtualModuleId = onlineAdInfoBean.getVirtualModuleId();
                    adInfoBean.mModuleId = onlineAdInfoBean.getModuleId();
                    adInfoBean.mAdId = onlineAdInfoBean.getAdPos();
                    adInfoBean.mCategory = "";
                    adInfoBean.mMapId = onlineAdInfoBean.getMapId();
                    adInfoBean.mPackageName = onlineAdInfoBean.getPackageName();
                    adInfoBean.mName = onlineAdInfoBean.getAppName();
                    adInfoBean.mIcon = onlineAdInfoBean.getIconUrl();
                    adInfoBean.mBanner = onlineAdInfoBean.getBannerUrl();
                    adInfoBean.mBannerTitle = "";
                    adInfoBean.mBannerDescribe = "";
                    adInfoBean.mIsH5Adv = false;
                    adInfoBean.mPreview = onlineAdInfoBean.getPreviewImgUrl();
                    adInfoBean.mVersionName = "";
                    adInfoBean.mVersionNumber = "0";
                    adInfoBean.mScore = "";
                    adInfoBean.mPrice = String.valueOf(onlineAdInfoBean.getPrice());
                    adInfoBean.mDeveloper = "";
                    adInfoBean.mDownloadCountStr = "";
                    adInfoBean.mDetail = onlineAdInfoBean.getAppInfo();
                    adInfoBean.mDownType = onlineAdInfoBean.getDownType();
                    adInfoBean.mDownUrl = onlineAdInfoBean.getTargetUrl();
                    adInfoBean.mRemdMsg = adInfoBean.mDetail;
                    adInfoBean.mAdSrc = 0;
                    adInfoBean.mShowCallUrl = onlineAdInfoBean.getShowUrl();
                    adInfoBean.mClickCallUrl = onlineAdInfoBean.getClickUrl();
                    adInfoBean.mInstallCallUrl = onlineAdInfoBean.getInstallCallUrl();
                    adInfoBean.mIsAd = 1;
                    adInfoBean.mAdUrl = onlineAdInfoBean.getTargetUrl();
                    adInfoBean.mAdPreload = onlineAdInfoBean.getPreClick();
                    adInfoBean.mAdType = 2;
                    adInfoBean.mAdInfoCacheFileName = onlineAdInfoBean.getAdInfoCacheFileName();
                    adInfoBean.mAdvDataSource = onlineAdInfoBean.getAdvDataSource();
                    adInfoBean.mCorpId = onlineAdInfoBean.getCorpId();
                    adInfoList.add(adInfoBean);
                }
            }

            return adInfoList;
        } else {
            return null;
        }
    }

    public static List<AdInfoBean> conversionFormAppInfoBean(List<BaseAppInfoBean> appInfoList) {
        if (appInfoList != null && !appInfoList.isEmpty()) {
            List<AdInfoBean> adInfoList = new ArrayList();
            Iterator var3 = appInfoList.iterator();

            while(var3.hasNext()) {
                BaseAppInfoBean appInfoBean = (BaseAppInfoBean)var3.next();
                if (appInfoBean != null) {
                    AdInfoBean adInfoBean = new AdInfoBean();
                    adInfoBean.mUASwitcher = appInfoBean.getUASwitcher();
                    adInfoBean.mVirtualModuleId = appInfoBean.getVirtualModuleId();
                    adInfoBean.mModuleId = appInfoBean.getModuleId();
                    adInfoBean.mAdId = appInfoBean.getAdId();
                    adInfoBean.mCategory = appInfoBean.getCategory();
                    adInfoBean.mMapId = appInfoBean.getMapId();
                    adInfoBean.mPackageName = appInfoBean.getPackageName();
                    adInfoBean.mName = appInfoBean.getName();
                    adInfoBean.mIcon = appInfoBean.getIcon();
                    adInfoBean.mBanner = appInfoBean.getBanner();
                    adInfoBean.mBannerTitle = appInfoBean.getBannerTitle();
                    adInfoBean.mBannerDescribe = appInfoBean.getBannerDescribe();
                    adInfoBean.mIsH5Adv = appInfoBean.getIsH5Adv();
                    adInfoBean.mPreview = appInfoBean.getPreView();
                    adInfoBean.mVersionName = appInfoBean.getVersionName();
                    adInfoBean.mVersionNumber = appInfoBean.getVersionNumber();
                    adInfoBean.mScore = appInfoBean.getScore();
                    adInfoBean.mPrice = appInfoBean.getPrice();
                    adInfoBean.mDeveloper = appInfoBean.getDeveloper();
                    adInfoBean.mDownloadCountStr = appInfoBean.getDownloadCountStr();
                    adInfoBean.mDetail = appInfoBean.getDetail();
                    adInfoBean.mDownType = appInfoBean.getDownType();
                    adInfoBean.mDownUrl = appInfoBean.getDownUrl();
                    adInfoBean.mRemdMsg = appInfoBean.getRemdMsg();
                    adInfoBean.mAdSrc = appInfoBean.getAdSrc();
                    adInfoBean.mShowCallUrl = appInfoBean.getShowCallUrl();
                    adInfoBean.mClickCallUrl = appInfoBean.getClickCallUrl();
                    adInfoBean.mInstallCallUrl = appInfoBean.getInstallCallUrl();
                    adInfoBean.mIsAd = appInfoBean.getIsAd();
                    adInfoBean.mAdUrl = appInfoBean.getAdUrl();
                    adInfoBean.mAdPreload = appInfoBean.getAdPreload();
                    adInfoBean.mAdType = appInfoBean.getAdType();
                    adInfoBean.mAdInfoCacheFileName = appInfoBean.getAdInfoCacheFileName();
                    adInfoBean.mAdvDataSource = appInfoBean.getAdvDataSource();
                    adInfoBean.mSize = appInfoBean.getSize();
                    adInfoBean.mIsBrandAdv = appInfoBean.isBrandAdv();
                    adInfoBean.mCparams = appInfoBean.getCparams();
                    adInfoBean.mImgfull = appInfoBean.getImgfull();
                    adInfoBean.mDSize = (long)appInfoBean.getDSize();
                    adInfoBean.mFrequency = appInfoBean.getFrequency();
                    adInfoList.add(adInfoBean);
                }
            }

            return adInfoList;
        } else {
            return null;
        }
    }


}
